/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package de.swta.components.unit;

import de.swta.components.category.*;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;

/**
 *
 * @author JKorreck
 */
public abstract class UnitActionPanel extends Panel {

    Units parent;

    String selectedID = "";
    /**
     * @param id
     *            component id
     * @param model
     *            model for contact
     * @param parent
     */
    public UnitActionPanel(String id, IModel model, Units parent) {
        super(id, model);
        this.parent = parent;
        
        add(new Link("edit") {

            public void onClick() {
                System.out.println("PARENT: " + this.getParent().getClassRelativePath());
                UnitActionPanel.this.parent.editSelectedItem((Unit) (this.getParent()).getDefaultModelObject());
                linkClicked();
            }
        });
    }

    public abstract void linkClicked();
}
